/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// RequestItem object for NHibernate mapped table 'request_item'.
	/// </summary>
	[Serializable]
	public class RequestItem
	{
		#region Member Variables
		protected int _requestitemid;
		protected Product _product;
		protected decimal? _quanity;
		protected IssueItemHeader _issueitemheader;
		#endregion
		#region Constructors
			
		public RequestItem() {}
					
		public RequestItem(Product product, decimal? quanity, IssueItemHeader issueitemheader) 
		{
			this._product= product;
			this._quanity= quanity;
			this._issueitemheader= issueitemheader;
		}

		public RequestItem(Product product, IssueItemHeader issueitemheader)
		{
			this._product= product;
			this._issueitemheader= issueitemheader;
		}
		
		#endregion
		#region Public Properties
		public int RequestItemId
		{
			get { return _requestitemid; }
			set {_requestitemid= value; }
		}
		public Product Product
		{
			get { return _product; }
			set {_product= value; }
		}
		public decimal? Quanity
		{
			get { return _quanity; }
			set {_quanity= value; }
		}
		public IssueItemHeader IssueItemHeader
		{
			get { return _issueitemheader; }
			set {_issueitemheader= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			RequestItem castObj = (RequestItem)obj;
			return ( castObj != null ) &&
			this._requestitemid == castObj.RequestItemId;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _requestitemid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
